package com.newsproject.service;

import java.util.ArrayList;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.web.servlet.ModelAndView;

import com.newsproject.pojo.Post;

@Service
public interface SearchInUserPageService {
    // 搜索自己的新闻
    public ArrayList<Post> searchMyNews(int user_id,
            String title,
            String start_time,
            String end_time,
            int type,
            int status,
            int startIndex,
            int pageSize);

    public ArrayList<Post> searchMyBookmarks(
            int user_id, 
            String title, 
            String start_time, 
            String end_time,
            int status,
            int startIndex,
            int pageSize);

    // 检查分类ID和用户ID是否存在
    public boolean checkCategoryIdOrUserId(int category_id, int user_id);

    // 检测时间范围是否合法
    public boolean checkTimeRange(String start_time, String end_time);

    public ModelAndView search(
            int user_id,
            String title,
            String start_time,
            String end_time,
            Integer category_id,
            Integer audit_status);

    public Map<String, Object> Search(
            int user_id,
            String title,
            String start_time,
            String end_time,
            Integer category_id,
            Integer audit_status,
            int page);

    public Map<String, Object> Search_bookmark(
            int user_id,
            String title,
            String start_time,
            String end_time,
            Integer audit_status,
            int page);
}
